package com.ruoyi.project.g6.tools;

import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;

/**
 * 构建带指定请求头的请求实体
 */
public class HttpEntityBuild {

    public static HttpEntity buildParams(Object params) {
        // 不设置的话给国家平台发请求会报415错误
        HttpHeaders headers = new HttpHeaders();
        headers.setContentType(MediaType.APPLICATION_JSON);
        return new HttpEntity<>(params, headers);
    }
}
